package com.neusoft.serviceImp;

import com.neusoft.mapper.SysFileMapper;
import com.neusoft.pojo.SysFile;
import com.neusoft.service.IDocumentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.List;
@Service
public class DocumentServiceImp implements IDocumentService{
    @Autowired(required = false)
    SysFileMapper sysFileMapper;

    //查询所有公共文档
    @Override
    public List<SysFile> searchList(SysFile sysFile) {
        return sysFileMapper.searchList(sysFile);
    }

    //查询
    @Override
    public List<SysFile>listOne( int id) {
        System.out.println(id+"DocumentServiceImp");
        return sysFileMapper.listOne(id);
    }
    @Override
    public List<SysFile> searchMyFile(int id, String fileType, String subjectKeywords) {
        return sysFileMapper.searchMyFile(id,fileType,subjectKeywords);
    }

    @Override
    public void insertFile(int workerId, String fileTitle, String fileType, String subjectKeywords, String fileAddress){
        sysFileMapper.insertFile(workerId,fileTitle, fileType, subjectKeywords, fileAddress);
    }


    @Override
    public void insertFileId(int workerId, String workerName){
        sysFileMapper.insertFileId(workerId,workerName);
    }
    @Override
    public java.util.List<SysFile> getFileId(int workerId){
        return sysFileMapper.getFileId(workerId);
    }
    @Override
    public void insertAddress(int fileId, String fileAddress){
        //System.out.println("123"+fileAddress);
        sysFileMapper.insertAddress(fileId,fileAddress);
        //System.out.println("456"+fileAddress);
    }

    @Override
    public void uploadAddress(int fileId,String fileTitle,String fileType,String subjectKeywords){
        sysFileMapper.upload(fileId,fileTitle,fileType,subjectKeywords);
    }
}
